package com.xishu.entity.order;

import com.xishu.annotation.dao.FieldMapping;
import com.xishu.annotation.dao.Search;
import com.xishu.annotation.oplog.OplogAnnotation;
import com.xishu.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.List;

@Entity(name = "send_to_kitchen_audit")
@Table(indexes = {@Index(columnList = "createTime")})
public class SendToKitchenAudit extends AbstractEntity {
    @ApiModelProperty(value = "商家")
    private Long shopId;

    @ApiModelProperty(value = "订单号")
    private Long orderId;

    @ApiModelProperty(value = "订单明细，订单里面的每一项")
    @FieldMapping(desField = "orderItemDetailList", serialize = false, genericType = "com.xishu.entity.order.OrderItem")
    @Lob
    @Column(columnDefinition = "MEDIUMTEXT")
    private String orderItemDetailJson;

    @Transient
    @ApiModelProperty(value = "订单明细")
    @FieldMapping(desField = "orderItemDetailJson", serialize = true)
    private List<OrderItem> orderItemDetailList;

    @ApiModelProperty(value = "状态，0表示没有操作，1表示通过，2表示失败")
    private Integer status;

    @ApiModelProperty(name = "订单编号，每次营业的顺序单号，从1开始")
    @OplogAnnotation(fieldName = "订单编号（数字）")
    @Search(groupName = "orderNo")
    private Integer orderNo;

    @ApiModelProperty(value = "金额")
    private Double cash;

    @ApiModelProperty(value = "联系方式")
    @Search(groupName = "orderNo")
    private String contact;

    @ApiModelProperty(value = "拼桌号，A1,B1,A2")
    private String code;

    @ApiModelProperty(value = "点餐种类，1堂食，2外卖,3外卖平台,4总二维码堂食")
    private Integer orderType;

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(Integer orderNo) {
        this.orderNo = orderNo;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public Double getCash() {
        return cash;
    }

    public void setCash(Double cash) {
        this.cash = cash;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderItemDetailJson() {
        return orderItemDetailJson;
    }

    public void setOrderItemDetailJson(String orderItemDetailJson) {
        this.orderItemDetailJson = orderItemDetailJson;
    }

    public List<OrderItem> getOrderItemDetailList() {
        return orderItemDetailList;
    }

    public void setOrderItemDetailList(List<OrderItem> orderItemDetailList) {
        this.orderItemDetailList = orderItemDetailList;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
